package com.snopy.designPattern.structure.flyweight;

import java.awt.*;

/**
 * @author snopy
 * @version 1.0.0
 * @classname TreeType
 * @description
 * @email 77912204@qq.com
 * @date 2022/11/26 23:58
 */
public class TreeType {

    private String name;

    private Color color;

    private String otherTreeData;

    public TreeType(String name, Color color, String otherTreeData) {
        this.name = name;
        this.color = color;
        this.otherTreeData = otherTreeData;
    }

    public void draw(Graphics g,int x,int y){
        g.setColor(Color.BLACK);
        g.fillRect(x - 1,y,3,5);
        g.setColor(color);
        g.fillOval(x - 5,y - 10,10,10);
    }
}
